package Tree;

/**
 * 作者:hfj
 * 功能:226.翻转二叉树
 * 日期: 2025/10/28 19:49
 */
public class InvertTree {

    public TreeNode invertTree(TreeNode root) {
        if (root == null){
            return root;
        }
        TreeNode temp = root.left;
        root.left = invertTree(root.right);
        root.right = invertTree(temp);
        return root;
    }
}
